import socket

# 1.建立tcp套接字
tcp_server = socket.socket()
# 2.绑定端口
tcp_server.bind(("",9876))
# 3.设置监听
tcp_server.listen(128)
# 4.
new_sever ,id_server = tcp_server.accept()
# 5.接收数据
new_data = new_sever.recv(1024)
print(new_data.decode("utf-8"))
